﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="UploadLAOSALVAGEaccounts.aspx.cs" 
Inherits="GMAC.ReportingSystem.Paginas.UploadLAOSALVAGEaccounts" Theme="Theme" EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <script type="text/javascript" src="../Scripts/CheckFramesAndRedirect.js"></script>
    <script type="text/javascript">
        function SendingFile() {
            var loading = document.getElementById("loading");            
            var btnSendFile = $get('btnSendFile');
            var btnBack = $get('btnBack');
            loading.style.display = 'block';
            btnSendFile.style.display = 'none';
            btnBack.style.display = 'none';
        }
    </script>
    <title></title>
    </head>
<body class="TotalBody">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true"></asp:ScriptManager>
    <div class="Contenedor" style = "padding-bottom: 10px; padding-top:10px;">
        <table cellpadding="0" cellspacing="0" border="0" style="width: 98%; vertical-align: top">
            <tr>
                <td style="text-align: left">
                    <span class="FontArialPaddingLeft20 TitleFontBlue FontArialBoldCaps">Upload</span></td>
            </tr>
            <tr>
                <td align="center">
                    <div class="WindowHeightMain">
                        <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; vertical-align: top">
                            <tr>
                                <td class="TDSeparadorV" colspan="2">
                                </td>
                            </tr>                        
                            <tr class="SearchBackground" style="width: 100%">
                                <td class="TDBorder">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td style="padding-left: 10px; text-align: left; width: 100%">
                                                <span class="FontArialBoldCaps" style="font-size: 14px">Upload LAO SALVAGE Accounts</span>
                                            </td>
                                            <td style="padding-right: 10px; text-align: right">
                                                <asp:ImageButton ID="imgCollapse" ImageAlign="Middle" ImageUrl="~/App_Themes/Theme/Images/Images IE6/Minus.gif"
                                                    Width="25px" Height="25px" runat="server" BorderWidth="0px" CausesValidation="false" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="1">
                                    <asp:Panel ID="pnlBusqueda" runat="server" SkinID="pnlBusqueda" Height="61px">
                                        <table cellpadding="0" cellspacing="0" border="0" visible="false">
                                            <tr>
                                                
                                                <td>
                                                    <table border="0" cellpadding="0" cellspacing="0">
                                                        <tr style="padding-left: 10px">
                                                            <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                File Uploaded
                                                            </td>
                                                            <td class="TDTextBox">
                                                                <asp:TextBox ID="txtFileUploaded" runat="server" ReadOnly="true" 
                                                                    SkinID="TextBox12px" TextMode="SingleLine" MaxLength="218"></asp:TextBox>
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="btnLoadFile" runat="server" ImageAlign="Top" 
                                                                    ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Find.jpg" 
                                                                    OnClick="btnLoadFile_Click" ToolTip="File Upload" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                    <cc1:CollapsiblePanelExtender ID="pnlBusqueda_Collapse" runat="server" TargetControlID="pnlBusqueda"
                                        CollapsedImage="~/App_Themes/Theme/Images/Images IE6/Plus.gif" ExpandedImage="~/App_Themes/Theme/Images/Images IE6/Minus.gif"
                                        CollapseControlID="imgCollapse" ExpandControlID="imgCollapse" Collapsed="false"
                                        SuppressPostBack="true" ImageControlID="imgCollapse"></cc1:CollapsiblePanelExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="TDSeparadorV" colspan="2"></td>
                            </tr>
                            <tr>
                                <td style="text-align: left" colspan="2">
                                    <asp:UpdatePanel ID="upLoaded" runat="server">
                                        <Triggers>
                                            <asp:PostBackTrigger ControlID="btnExportToExcel"/>
                                        </Triggers>
                                        <ContentTemplate>
                                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblResults" runat="server" CssClass="FontVerdana"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="LabelRight12px" style="height: 50px" width="100%">
                                                        <asp:LinkButton ID="btnSuccessful" CssClass="Result, FontVerdana" runat="server"
                                                            CausesValidation="false" Text="Successful" OnClick="btnSuccessful_Click"></asp:LinkButton>&nbsp;<asp:LinkButton
                                                                ID="btnFailed" runat="server" Text="Failed" CssClass="Result, FontVerdana" OnClick="btnFailed_Click"
                                                                CausesValidation="false"></asp:LinkButton>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <span id="spanGridTitleSuccessful" runat="server" class="FontVerdanaBold">Collections Loaded</span>
                                                        <span id="spanGridTitleFailed" runat="server" class="FontVerdanaBold">Collections Not Loaded</span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:GridView ID="grvSuccessful" runat="server" AutoGenerateColumns="False" 
                                                            SkinID="GridGMAC" Width="100%" CellPadding="2" 
                                                            onpageindexchanging="grvSuccessful_PageIndexChanging" AllowSorting="True" 
                                                            onsorting="grvSuccessful_Sorting">
                                                            <Columns>
                                                               <asp:BoundField HeaderText="AccountNumber" DataField="AccountNumber" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="AccountNumber" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Status" DataField="AccountStatusCode" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="AccountStatusCode" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Status Date" DataField="AccountStatusDate" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="AccountStatusDate" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Dealer Name" DataField="DealerName" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="DealerName">
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Dealer Number" DataField="DealerNumber" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="DealerNumber">
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Field Rep" DataField="ThirdPartyName" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="ThirdPartyName">
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Type Field Rep" DataField="ThirdPartyTypeCode" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="ThirdPartyTypeCode">
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Total Amount" DataField="CurrentTotalAmount" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="CurrentTotalAmount">
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                            </Columns>
                                                        </asp:GridView>
                                                        <asp:GridView ID="grvFailed" runat="server" AutoGenerateColumns="False" 
                                                        SkinID="GridGMAC" Width="100%" CellPadding="2" AllowSorting="True"
                                                            onpageindexchanging="grvFailed_PageIndexChanging" 
                                                            onsorting="grvFailed_Sorting">
                                                            <Columns>
                                                                <asp:BoundField HeaderText="AccountNumber" DataField="AccountNumber" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="AccountNumber" >
                                                                    <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Status" DataField="AccountStatusCode" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="AccountStatusCode" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Status Date" DataField="AccountStatusDate" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="AccountStatusDate" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Dealer Name" DataField="DealerName" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="DealerName" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Dealer Number" DataField="DealerNumber" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="DealerNumber" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Field Rep" DataField="ThirdPartyName" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="ThirdPartyName" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Type Field Rep" DataField="ThirdPartyTypeCode" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="ThirdPartyTypeCode" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                               <asp:BoundField HeaderText="Total Amount" DataField="CurrentTotalAmount" 
                                                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" 
                                                                    SortExpression="CurrentTotalAmount" >
                                                                   <HeaderStyle HorizontalAlign="Center" CssClass="HeaderGridBackgrounda" />
                                                                   <ItemStyle HorizontalAlign="Center" />
                                                                </asp:BoundField>
                                                                <asp:TemplateField HeaderText="Rejection Reason" SortExpression="RejectionReason_Small">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="Label1" runat="server" 
                                                                            Text='<%# Bind("RejectionReason_Small") %>' 
                                                                            ToolTip='<%# Bind("RejectionReason") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <HeaderStyle CssClass="HeaderGridBackgrounda" HorizontalAlign="Center" />
                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                </asp:TemplateField>
                                                            </Columns>
                                                        </asp:GridView>
                                                        <asp:ImageButton ID="btnExportToExcel" runat="server" OnClick="btnExportToExcel_Click"
                                                            CausesValidation="false" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/Export_Button.gif" />
                                                        <asp:ImageButton ID="btnProcessFile" runat="server" CausesValidation="false" 
                                                        
                                                            ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Process.jpg" 
                                                            onclick="btnProcessFile_Click" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                </tr>
                                            </table>
                                            <asp:HiddenField ID="hidOrderDirFailed" runat="server" />
                                            <asp:HiddenField ID="hidOrderByFailed" runat="server" />
                                            <asp:HiddenField ID="hidOrderDirSuccessful" runat="server" />
                                            <asp:HiddenField ID="hidOrderBySuccessful" runat="server" />
                                            
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:UpdatePanel ID="upLoadFile" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnLoadFile" EventName="Click"/>
            <asp:PostBackTrigger ControlID="btnSendFile" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel ID="pnlPopupLoadFile" runat="server" CssClass="modalPopup" Height="140px"
                Style="display: none;" Width="400px">
                <table width="100%">
                    <tr style="height: 100px">
                        <td style="height: 100%;" align="center">
                            <uc2:wucFileUpload  ID="wucFileUploadLoans" runat="server" Extensions="xls|xlsx"/>
                            <%--<asp:CustomValidator ID="custWucFileUploadLoans" runat="server" ControlToValidate="wucFileUploadLoans" OnServerValidate="custWucFileUploadLoans_ServerValidate" ErrorMessage="Make sure the file name or path does not have more than 218 characters"></asp:CustomValidator>
                            <cc1:ValidatorCalloutExtender ID="vceWucFileUploadLoans" runat="server" TargetControlID="custWucFileUploadLoans"></cc1:ValidatorCalloutExtender>--%>
                        </td>
                    </tr>
                    <tr style="vertical-align: bottom">
                        <td align="center">
                            <img id="loading" src="../App_Themes/Theme/Images/ajax-loader.gif" alt="Sending File" style="display: none" />
                        </td>
                    </tr>
                    <tr style="vertical-align: bottom">
                        <td align="center">
                            <asp:ImageButton ID="btnBack" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Back.jpg"
                            CausesValidation="false" />
                            <asp:ImageButton ID="btnSendFile" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Send.jpg"
                            OnClick="btnSendFile_Click" OnClientClick="return SendingFile();" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <cc1:ModalPopupExtender ID="popupExtenderLoadFile" runat="server" BackgroundCssClass="modalBackground"
                CancelControlID="btnBack" DropShadow="false" OnOkScript="onOK();" PopupControlID="pnlPopupLoadFile"
                TargetControlID="lnkPopupLoadFile">
            </cc1:ModalPopupExtender>
            <asp:LinkButton ID="lnkPopupLoadFile" runat="server"></asp:LinkButton>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="upMessage" runat="server">
        <Triggers>
            
        </Triggers>
        <ContentTemplate>
            <asp:Panel ID="pnlMessage" runat="server" CssClass="modalPopup" Height="140px" Style="display: none;"
                Width="400px">
                <table width="100%">
                    <tr style="height: 100px">
                        <td style="height: 100%;" align="center">
                            <uc1:wucMessage ID="wucMessage" runat="server" />
                        </td>
                    </tr>
                    <tr style="vertical-align: bottom">
                        <td align="center">
                            <asp:ImageButton  ID="btnAceptar" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Accept.jpg"
                            OnClick="btnAceptar_Click" CausesValidation="false" />
                        </td>
                    </tr>
                </table>    
            </asp:Panel>
            <cc1:ModalPopupExtender ID="popupExtenderMessage" runat="server" BackgroundCssClass="modalBackground" DropShadow="false"
            OnOkScript="onOK();" PopupControlID="pnlMessage" TargetControlID="lnkPopupMessage"></cc1:ModalPopupExtender>
            <asp:LinkButton ID="lnkPopupMessage" runat="server"></asp:LinkButton>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
